<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

        <script type="text/javascript">
            
            $('.filtroStatus').livequery('change',function(){

                statusSelecionado = $(this).val();

                $.ajax({
                    type: "GET",
                    url: "<?php echo url_for('listagem/ListarStatusAjax')?>",
                    data: {IdStatus: statusSelecionado},
                    cache: false,
                    beforeSend: function(){
                        $.blockUI({message:"<h1>Aguarde...</h1>"});
                    },
                    success: function(data){
                        $.unblockUI();
                        $('#retornoajax').html(data);
                    }
                }); // fim do ajax
                return false;
            }) // fim filtroStatus

            $('.clearfiltro').livequery('click',function(){

                $('.filtroStatus').find('option[value=""]').attr('selected',true);
            });
        </script>

        <label>Status: </label>
        <select class="filtroStatus" style="width: 280px">
            <option value="">Selecione o status...</option>
             <?php
                  for ($i = 0; $i < count($listaStatus); $i++) {
             ?>
             <option value="<?php echo $listaStatus[$i]['IdStatus'] ?>"><?php echo $listaStatus[$i]['DescricaoStatus'] ?></option>
             <?php
                  }
             ?>
        </select>
            <button type="reset" value="Limpar filtro..." class="botaoLimparCinza clearfiltro">Limpar filtro...</button>
        <div id="retornoajax">
            <?php
                include_partial('listaInscricoes', array('listaInscricoesStatus' => $listaInscricoesStatus,'listaStatus'=>$listaStatus)) ;
            ?>
        </div>
    
        </form>